
import React, { Component } from 'react'

import { Route } from 'react-router-dom'

import Child1 from './views/Child1'
import Child2 from './views/Child2'
import MyLink from './components/MyLink'

class App2 extends Component {
  render() {
    return (
      <div>
        {/* 自定义导航组件 */}
        <MyLink tag="h3" active-class="active" to="/child1">Child1</MyLink>
        <MyLink tag="h3" to="/child2">Child2</MyLink>

        <Route path="/child1" component={Child1} />
        <Route path="/child2" component={Child2} />
      </div>
    );
  }
}

export default App2;
